package com.lingyue.entity.module.biz.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.LocalDateTypeHandler;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author lizhiyuan
 * @since 2019-11-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("opportunities")
@ApiModel(value = "OpportunitiesEntity对象", description = "")
public class OpportunitiesEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "OPT_ID", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField("OPT_API_UNIQUE_KEY")
    private String apiUniqueKey;

    @ApiModelProperty(value = "经销商id")
    @TableField("OPT_DEL_ID")
    private Long delId;

    @ApiModelProperty(value = "车架号")
    @TableField("OPT_VEH_VIN")
    private String vehVin;

    @ApiModelProperty(value = "活动编号")
    @TableField("OPT_CAM_CODE")
    private String camCode;

    @ApiModelProperty(value = "活动名称")
    @TableField("OPT_CAM_NAME")
    private String camName;

    @ApiModelProperty(value = "活动背景")
    @TableField("OPT_TEXT")
    private String text;

    @ApiModelProperty(value = "金融密文")
    @TableField("OPT_SF_COMBINED")
    private String sfCombined;

    @ApiModelProperty(value = "逾期日期")
    @TableField(value = "OPT_DUEDATE", typeHandler = LocalDateTypeHandler.class)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate dueDate;

    @ApiModelProperty(value = "线索归属人账号")
    @TableField("OPT_BELONG")
    private String belong;

    @ApiModelProperty(value = "分配日期")
    @TableField("OPT_ASSIGN_DATE")
    private LocalDateTime assignDate;

    @ApiModelProperty(value = "建议处理人账号")
    @TableField("OPT_FOLLOWER_SUGGESTED")
    private String followerSuggested;

    @ApiModelProperty(value = "实际跟进人账号")
    @TableField("OPT_FOLLOWER")
    private String follower;

    @ApiModelProperty(value = "0:未分配、7:未处理、10:客户预约、11:咨询专家、12:持续跟进、13:意向客户、14:二手车评估、20:客户拒绝、21:NSP拒绝、22:预约到店、23:非预约到店、24:金融成交、25:二手车成交、99:失效")
    @TableField("OPT_RESPONSE_STATUS")
    private Integer responseStatus;

    @ApiModelProperty(value = "处理日期")
    @TableField("OPT_RESPONSE_DATE")
    private LocalDateTime responseDate;

    @ApiModelProperty(value = "是否接通")
    @TableField("OPT_CONNECTED")
    private String connected;

    @ApiModelProperty(value = "上次跟进人账号")
    @TableField("OPT_PRE_FOLLOWER")
    private String preFollower;

    @ApiModelProperty(value = "上次跟进日期")
    @TableField("OPT_PRE_RESPONSE_DATE")
    private LocalDateTime preResponseDate;

    @ApiModelProperty(value = "客户预约日期")
    @TableField("OPT_APPOINTMENT_DATE")
    private LocalDateTime appointmentDate;

    @ApiModelProperty(value = "客户到店日期")
    @TableField(value = "OPT_RESCHEDULED_DATE", updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime rescheduledDate;

    @ApiModelProperty(value = "NSP/BATCH/ASSISTANT")
    @TableField("OPT_DATA_SOURCE")
    private String dataSource;

    @ApiModelProperty(value = "是否有效")
    @TableField("OPT_VALID_FLAG")
    private String validFlag;

    @ApiModelProperty(value = "线索标识（C-create、U-update、E-expired、D-delete、1-go to his shop、2-back to the store）")
    @TableField("OPT_LEADS_STATUS")
    private String leadsStatus;

    @ApiModelProperty(value = "意向车型")
    @TableField("OPT_PURPOSE_MODEL")
    private String purposeModel;

    @ApiModelProperty(value = "成交类型")
    @TableField("OPT_PURCHASE_TYPE")
    private String purchaseType;

    @ApiModelProperty(value = "部门")
    @TableField("OPT_DEPARTMENT")
    private String department;

    @ApiModelProperty(value = "联系方式: 微信/座机等,详见数据字典")
    @TableField("OPT_CONTACT_WAY")
    private String contactWay;

    @TableField("OPT_REMARK")
    private String remark;

    @TableField("OPT_CREATE_USER")
    private String createUser;

    @TableField("OPT_CREATE_DATE")
    private LocalDateTime createDate;

    @TableField("OPT_UPDATE_USER")
    private String updateUser;

    @TableField("OPT_UPDATE_DATE")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "Teleservice ticket id. Only present for tele service campaign.")
    @TableField("OPT_TICKET_ID")
    private String ticketId;

    @ApiModelProperty(value = "远程单创建时间")
    @TableField("OPT_TICKET_CREATION_DATE")
    private LocalDateTime ticketCreationDate;

    @ApiModelProperty(value = "预约类型")
    @TableField(value = "OPT_APPOINTMENT_TYPE", updateStrategy = FieldStrategy.IGNORED)
    private String appointmentType;

    @ApiModelProperty(value = "是否存在级联数据")
    @TableField(exist = false)
    private String cascade;

    @ApiModelProperty(value = "dms推送标识 0/1/null 1代表需要推送")
    @TableField("OPT_DMS_PUSH_FLAG")
    private String dmsPushFlag;

    @ApiModelProperty(value = "tssb总体：D未转换|1有一项或多项本店转换|2是有1或多项他店转换其余都是未转换")
    @TableField("OPT_ARRIVAL_STATUS")
    private String arrivalStatus;

    @ApiModelProperty(value = "开单后返本店时间")
    @TableField("OPT_BACK_THE_DEALER_DATE")
    private LocalDateTime backTheDealerDate;

    @ApiModelProperty(value = "开单后返他店时间")
    @TableField("OPT_BACK_OTHER_DEALER_DATE")
    private LocalDateTime backOtherDealerDate;

    @ApiModelProperty(value = "转换时间")
    @TableField("OPT_CONVERT_DATE")
    private LocalDateTime convertDate;


    public static final String OPT_ID = "OPT_ID";
    public static final String OPT_API_UNIQUE_KEY = "OPT_API_UNIQUE_KEY";
    public static final String OPT_DEL_ID = "OPT_DEL_ID";
    public static final String OPT_VEH_VIN = "OPT_VEH_VIN";
    public static final String OPT_CAM_CODE = "OPT_CAM_CODE";
    public static final String OPT_CAM_NAME = "OPT_CAM_NAME";
    public static final String OPT_TEXT = "OPT_TEXT";
    public static final String OPT_SF_COMBINED = "OPT_SF_COMBINED";
    public static final String OPT_DUEDATE = "OPT_DUEDATE";
    public static final String OPT_BELONG = "OPT_BELONG";
    public static final String OPT_ASSIGN_DATE = "OPT_ASSIGN_DATE";
    public static final String OPT_FOLLOWER_SUGGESTED = "OPT_FOLLOWER_SUGGESTED";
    public static final String OPT_FOLLOWER = "OPT_FOLLOWER";
    public static final String OPT_RESPONSE_STATUS = "OPT_RESPONSE_STATUS";
    public static final String OPT_RESPONSE_DATE = "OPT_RESPONSE_DATE";
    public static final String OPT_CONNECTED = "OPT_CONNECTED";
    public static final String OPT_PRE_FOLLOWER = "OPT_PRE_FOLLOWER";
    public static final String OPT_PRE_RESPONSE_DATE = "OPT_PRE_RESPONSE_DATE";
    public static final String OPT_APPOINTMENT_DATE = "OPT_APPOINTMENT_DATE";
    public static final String OPT_RESCHEDULED_DATE = "OPT_RESCHEDULED_DATE";
    public static final String OPT_DATA_SOURCE = "OPT_DATA_SOURCE";
    public static final String OPT_VALID_FLAG = "OPT_VALID_FLAG";
    public static final String OPT_LEADS_STATUS = "OPT_LEADS_STATUS";
    public static final String OPT_PURPOSE_MODEL = "OPT_PURPOSE_MODEL";
    public static final String OPT_PURCHASE_TYPE = "OPT_PURCHASE_TYPE";
    public static final String OPT_DEPARTMENT = "OPT_DEPARTMENT";
    public static final String OPT_CONTACT_WAY = "OPT_CONTACT_WAY";
    public static final String OPT_REMARK = "OPT_REMARK";
    public static final String OPT_CREATE_USER = "OPT_CREATE_USER";
    public static final String OPT_CREATE_DATE = "OPT_CREATE_DATE";
    public static final String OPT_UPDATE_USER = "OPT_UPDATE_USER";
    public static final String OPT_UPDATE_DATE = "OPT_UPDATE_DATE";
    public static final String OPT_TICKET_ID = "OPT_TICKET_ID";
    public static final String OPT_TICKET_CREATION_DATE = "OPT_TICKET_CREATION_DATE";
    public static final String OPT_APPOINTMENT_TYPE = "OPT_APPOINTMENT_TYPE";
    public static final String OPT_DMS_PUSH_FLAG = "OPT_DMS_PUSH_FLAG";
    public static final String OPT_ARRIVAL_STATUS = "OPT_ARRIVAL_STATUS";
    public static final String OPT_BACK_THE_DEALER_DATE = "OPT_BACK_THE_DEALER_DATE";
    public static final String OPT_BACK_OTHER_DEALER_DATE = "OPT_BACK_OTHER_DEALER_DATE";
    public static final String OPT_CONVERT_DATE = "OPT_CONVERT_DATE";

}
